package main

import (
	"crypto/rand"
	"encoding/hex"
	"fmt"
	"os"
	"strconv"
)

func main() {
	if len(os.Args) < 2 {
		fmt.Println("Usage: go run generate_transactions.go <count>")
		fmt.Println("Example: go run generate_transactions.go 100")
		os.Exit(1)
	}

	count, err := strconv.Atoi(os.Args[1])
	if err != nil {
		fmt.Printf("Invalid count: %v\n", err)
		os.Exit(1)
	}

	// Generate transactions of 250 bytes each
	for i := 0; i < count; i++ {
		tx := generateTransaction(250)
		fmt.Printf("TX_%d:%s\n", i, tx)
	}
}

func generateTransaction(size int) string {
	// Generate random bytes
	bytes := make([]byte, size)
	_, err := rand.Read(bytes)
	if err != nil {
		panic(err)
	}
	
	// Convert to hex string
	return hex.EncodeToString(bytes)
}


